using UnityEngine;
using System.Collections;

namespace Perks{
	public class DoubleStamina : Perk{
		public const string Name = "Double Stamina";
		//Atributo que modifica al equipar.
		private SUB_ATTRIBUTES affectingSubAttribute;
		
		public DoubleStamina(){
			this.equipCost = 1;
			this.affectingSubAttribute = SUB_ATTRIBUTES.STAMINA;
			this.bonusPercentage = 100;
			this.description = 
				"Doubles STAMINA base and dependecy attributes bonus. \n" +
				"Adds 100% To percentage bonus for Stamina.";
								
			SetRequirements();
		}
		
		protected override void SetRequirements(){
			requirements = new RequirementPair[2];
			requirements[0].baseAttribute = ATTRIBUTES.CONSTITUTION;
			requirements[0].requiredValue = 5;
			requirements[1].baseAttribute = ATTRIBUTES.AGILITY;
			requirements[1].requiredValue = 2;
		}
		public override string GetName (){return DoubleStamina.Name;}
		public override void OnEquip (AttributeSet aSet)
		{
			aSet.AddPercetageBonusToSubAttribute(SUB_ATTRIBUTES.STAMINA, bonusPercentage);
	/*		float baseAttribValue = aSet.GetSubAttributeBaseValue(affectingSubAttribute);
			aSet.AddBonusToSubAttribute(this.affectingSubAttribute, 
				baseAttribValue + aSet.GetDependenciesBonusOfSubAttribute(affectingSubAttribute));
	*/	}
		public override void OnUnEquip (AttributeSet aSet)
		{
			aSet.AddPercetageBonusToSubAttribute(SUB_ATTRIBUTES.STAMINA, -bonusPercentage);
	/*		float baseAttribValue = aSet.GetSubAttributeBaseValue(affectingSubAttribute);
			aSet.AddBonusToSubAttribute(this.affectingSubAttribute, 
				-(baseAttribValue + aSet.GetDependenciesBonusOfSubAttribute(affectingSubAttribute)));
	*/	}
	}
}